package com.yvdedu.hospital.service.impl;

import java.util.List;
import java.util.Set;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yvdedu.hospital.entity.Login;
import com.yvdedu.hospital.entity.Role;
import com.yvdedu.hospital.entity.User;
import com.yvdedu.hospital.mapper.LoginMapper;
import com.yvdedu.hospital.service.LoginService;

@Service
public class LoginSer implements LoginService {
	
	@Resource
	private LoginMapper loginMapper;

	@Override
	public List<Login> login(Login login) {
		
		List<Login> list = loginMapper.login(login);
		return list;
	}

	@Override
	public List<User> userquery(int id) {
		List<User> list = loginMapper.userquery(id);
		return list;
	}

	@Override
	public List<Role> rolequery(int id) {
		List<Role> list = loginMapper.rolequery(id);
		return list;
	}

	@Override
	public Login loginquery(Login login) {
		
		Login loginN = loginMapper.loginquery(login);
		return loginN;
	}

	@Override
	public void loginadd(Login login) {
		loginMapper.loginadd(login);
		
	}

	@Override
	public Set<String> roleName(int id) {
		Set<String> roles = loginMapper.roleName(id);
		return roles;
	}

	@Override
	public Set<String> url(int id) {
		Set<String> urls = loginMapper.url(id);
		return urls;
	}

}
